//
//  BaseButton.m
//  沙哈拉FM
//
//  Created by dllo on 15/11/2.
//  Copyright © 2015年 S1mpl3. All rights reserved.
//
#import "PhoneInfo.h"
#import "BaseButton.h"
#import "Model.h"

@implementation BaseButton

-(instancetype)init{
    self = [super init];
    if (self) {
        [self changeColor];
    }
    return self;
}

-(void)setFontSize:(CGFloat)fontSize{

    if ([[PhoneInfo showPhoneInfo] isEqualToString:@"iPhone 4 (A1332)"] || [[PhoneInfo showPhoneInfo] isEqualToString:@"iPhone 4 (A1349)" ]|| [[PhoneInfo showPhoneInfo] isEqualToString:@"iPhone 4S (A1387/A1431)"]) {
        self.titleLabel.font = [UIFont systemFontOfSize:fontSize];
    }else if ([[PhoneInfo showPhoneInfo] isEqualToString:@"iPhone 5 (A1428)"] || [[PhoneInfo showPhoneInfo] isEqualToString:@"iPhone 5 (A1429/A1442)" ] || [[PhoneInfo showPhoneInfo] isEqualToString:@"iPhone 5c (A1456/A1532)"] || [[PhoneInfo showPhoneInfo] isEqualToString:@"iPhone 5c (A1507/A1516/A1526/A1529)"] || [[PhoneInfo showPhoneInfo] isEqualToString:@"iPhone 5s (A1453/A1533)"] || [[PhoneInfo showPhoneInfo] isEqualToString:@"iPhone 5s (A1457/A1518/A1528/A1530)"]){
        self.titleLabel.font = [UIFont systemFontOfSize:1.2 * fontSize];
    }else if ([[PhoneInfo showPhoneInfo] isEqualToString:@"iPhone 6 (A1549/A1586)"] || [[PhoneInfo showPhoneInfo] isEqualToString:@"iPhone 6s (A1633/A1688/A1691/A1700)" ]){
        self.titleLabel.font = [UIFont systemFontOfSize:1.3 * fontSize];
    }else if ([[PhoneInfo showPhoneInfo] isEqualToString:@"iPhone 6 Plus (A1522/A1524)"] || [[PhoneInfo showPhoneInfo] isEqualToString:@"iPhone 6s Plus (A1634/A1687/A1690/A1699)" ]){
        self.titleLabel.font = [UIFont systemFontOfSize:1.5 * fontSize];
    }


}

-(void)changeColor{
    self.backgroundColor = [Model shareInstance].ViewColor;
    self.titleLabel.textColor = [Model shareInstance].TitleColor;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
